@@ -9,7 +9,7 @@ import React, { useState } from "react";
9
9
import { feedbackError } from "../lib/ui" ;
10
10
import { useRouter } from "next/router" ;
11
11
import { branding } from "../lib/branding" ;
12
- import { credentialsLoginEnabled , githubLoginEnabled , oidcLoginConfig } from "../lib/nextauth.config" ;
12
+ import { credentialsLoginEnabled , githubLoginEnabled , oidcLoginEnabled } from "../lib/nextauth.config" ;
13
13
import { useQuery } from "@tanstack/react-query" ;
14
14
15
15
function JitsuLogo ( ) {
@@ -21,7 +21,7 @@ function JitsuLogo() {
21
21
) ;
22
22
}
23
23
24
- function CredentialsForm ( { } ) {
24
+ function CredentialsForm ( ) {
25
25
const lastUsedLogin = localStorage . getItem ( "last-used-login-email" ) || undefined ;
26
26
const { data, isLoading, error } = useQuery ( [ "next-auth-csrfToken" ] , async ( ) => {
27
27
return {
@@ -130,12 +130,12 @@ const NextAuthSignInPage = ({ csrfToken, providers: { github, oidc, credentials
130
130
return (
131
131
< div className = "w-screen h-screen flex flex-col items-center justify-center" >
132
132
< AlertTriangle className = "w-32 h-32 text-error" />
133
- < div className = "mt-3 text-textLight text-center" >
133
+ < p className = "mt-3 text-textLight text-center" >
134
134
This page should not be used if Firebase authorization is enabled. Please proceed to a{ " " }
135
135
< Link href = "/" className = "underline text-primary" >
136
136
main page of the app
137
137
</ Link >
138
- </ div >
138
+ </ p >
139
139
</ div >
140
140
) ;
141
141
}
@@ -144,34 +144,34 @@ const NextAuthSignInPage = ({ csrfToken, providers: { github, oidc, credentials
144
144
< div className = "space-y-2 flex justify-center h-16" >
145
145
< JitsuLogo />
146
146
</ div >
147
- < div className = { "flex flex-col gap-1.5" } >
147
+ < div className = "flex flex-col gap-1.5" >
148
148
{ credentials . enabled && < CredentialsForm /> }
149
149
{ credentials . enabled && ( github . enabled || oidc . enabled ) && < hr className = "my-4" /> }
150
150
{ github . enabled && < GitHubSignIn /> }
151
151
{ oidc . enabled && < OIDCSignIn /> }
152
152
</ div >
153
153
{ router . query . error && (
154
- < div className = "text-error" >
154
+ < p className = "text-error" >
155
155
Something went wrong. Please try again. Error code: < code > { router . query . error } </ code >
156
- </ div >
156
+ </ p >
157
157
) }
158
158
{ ! app . disableSignup && ( github . enabled || oidc . enabled ) && (
159
- < div className = "text-center text-textLight text-xs" >
159
+ < p className = "text-center text-textLight text-xs" >
160
160
Automatic signup is enabled for this instance. Sign in with github and if you don't have an account, a new
161
161
account will be created automatically. This account won't have any access to pre-existing project unless the
162
162
access is explicitly granted
163
- </ div >
163
+ </ p >
164
164
) }
165
165
</ div >
166
166
) ;
167
167
} ;
168
168
169
- export async function getServerSideProps ( context ) {
169
+ export async function getServerSideProps ( ) {
170
170
if ( process . env . FIREBASE_AUTH ) {
171
171
throw new Error ( `Firebase auth is enabled. This page should not be used.` ) ;
172
172
}
173
- if ( ! githubLoginEnabled && ! credentialsLoginEnabled && ! oidcLoginConfig ) {
174
- throw new Error ( `No auth providers are enabled found. Available providers: github, credentials` ) ;
173
+ if ( ! githubLoginEnabled && ! credentialsLoginEnabled && ! oidcLoginEnabled ) {
174
+ throw new Error ( `No auth providers are enabled found. Available providers: github, credentials, OIDC ` ) ;
175
175
}
176
176
return {
177
177
props : {
@@ -184,7 +184,7 @@ export async function getServerSideProps(context) {
184
184
enabled : githubLoginEnabled ,
185
185
} ,
186
186
oidc : {
187
- enabled : ! ! oidcLoginConfig ,
187
+ enabled : oidcLoginEnabled ,
188
188
} ,
189
189
} ,
190
190
publicPage : true ,
0 commit comments