Previously, signing up gave immediate access to the app. Now, unconfirmed users are redirected to a verification page where they can resend the confirmation email. - After signup, the user is routed to `/auth/verify-email` instead of the dashboard - After login, unconfirmed users are redirected to the verification page - The dashboard route guard catches unconfirmed users and redirects them - `active_for_authentication?` is removed from the sessions controller so unconfirmed users can authenticate — the frontend gates access instead - If the user visits the verification page after already confirming, they're automatically redirected to the dashboard - No session is issued until the user is verified <details><summary>Demo</summary> <p> #### Fresh Signup https://github.com/user-attachments/assets/abb735e5-7c8e-44a2-801c-96d9e4823e51 #### Google Fresh Signup https://github.com/user-attachments/assets/ab9e389a-a604-4a9d-b492-219e6d94ee3f #### Create new account from Dashboard https://github.com/user-attachments/assets/c456690d-1946-4e0b-834b-ad8efcea8369 </p> </details> --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
78 lines
2.1 KiB
JavaScript
78 lines
2.1 KiB
JavaScript
import { frontendURL } from 'dashboard/helper/URLHelper';
|
|
|
|
import Login from './login/Index.vue';
|
|
import SamlLogin from './login/Saml.vue';
|
|
import Signup from './auth/signup/Index.vue';
|
|
import ResetPassword from './auth/reset/password/Index.vue';
|
|
import Confirmation from './auth/confirmation/Index.vue';
|
|
import VerifyEmail from './auth/verify-email/Index.vue';
|
|
import PasswordEdit from './auth/password/Edit.vue';
|
|
|
|
export default [
|
|
{
|
|
path: frontendURL('login'),
|
|
name: 'login',
|
|
component: Login,
|
|
props: route => ({
|
|
config: route.query.config,
|
|
email: route.query.email,
|
|
ssoAuthToken: route.query.sso_auth_token,
|
|
ssoAccountId: route.query.sso_account_id,
|
|
ssoConversationId: route.query.sso_conversation_id,
|
|
authError: route.query.error,
|
|
}),
|
|
},
|
|
{
|
|
path: frontendURL('login/sso'),
|
|
name: 'sso_login',
|
|
component: SamlLogin,
|
|
meta: { requireEnterprise: true },
|
|
props: route => ({
|
|
authError: route.query.error,
|
|
target: route.query.target,
|
|
}),
|
|
},
|
|
{
|
|
path: frontendURL('auth/signup'),
|
|
name: 'auth_signup',
|
|
component: Signup,
|
|
meta: { requireSignupEnabled: true },
|
|
},
|
|
{
|
|
path: frontendURL('auth/confirmation'),
|
|
name: 'auth_confirmation',
|
|
component: Confirmation,
|
|
meta: { ignoreSession: true },
|
|
props: route => ({
|
|
config: route.query.config,
|
|
confirmationToken: route.query.confirmation_token,
|
|
redirectUrl: route.query.route_url,
|
|
}),
|
|
},
|
|
{
|
|
path: frontendURL('auth/verify-email'),
|
|
name: 'auth_verify_email',
|
|
component: VerifyEmail,
|
|
meta: { ignoreSession: true },
|
|
props: () => ({
|
|
email: window.history.state?.email || '',
|
|
}),
|
|
},
|
|
{
|
|
path: frontendURL('auth/password/edit'),
|
|
name: 'auth_password_edit',
|
|
component: PasswordEdit,
|
|
meta: { ignoreSession: true },
|
|
props: route => ({
|
|
config: route.query.config,
|
|
resetPasswordToken: route.query.reset_password_token,
|
|
redirectUrl: route.query.route_url,
|
|
}),
|
|
},
|
|
{
|
|
path: frontendURL('auth/reset/password'),
|
|
name: 'auth_reset_password',
|
|
component: ResetPassword,
|
|
},
|
|
];
|