-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nuxt-auth): configurable auth components via app config
- Loading branch information
Showing
7 changed files
with
210 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import {string, boolean, ref as YupRef} from 'yup'; | ||
|
||
export default defineAppConfig({ | ||
auth: { | ||
logo: true, | ||
redirect: { | ||
home: '/', // redirect to home page after login | ||
}, | ||
login: { | ||
logo: true, | ||
head: { | ||
title: 'Login', | ||
}, | ||
title: 'Login', | ||
description: 'Enter your username and password to login.', | ||
usernameProps: { | ||
label: 'Username', | ||
placeholder: 'Username', | ||
}, | ||
passwordProps: { | ||
label: 'Password', | ||
placeholder: 'Password', | ||
}, | ||
rememberMe: { | ||
enabled: true, | ||
label: 'Remember Me', | ||
}, | ||
submitText: 'Login', | ||
submitProps: { | ||
color: 'primary', | ||
block: true, | ||
}, | ||
forgotPasswordLinkText: 'Forgot Password?', | ||
registerLinkText: 'Register', | ||
registerText: "Don't have an account?", | ||
loginWithText: 'Login with', | ||
orText: 'or', | ||
providerButtonColors: { | ||
google: 'danger', | ||
facebook: 'primary', | ||
twitter: 'info', | ||
github: 'dark', | ||
} as Record<string, string>, | ||
}, | ||
register: { | ||
head: { | ||
title: 'Register', | ||
}, | ||
logo: true, | ||
title: 'Register', | ||
description: 'Enter your details to create your account.', | ||
buttonText: 'Register', | ||
buttonProps: { | ||
color: 'primary', | ||
block: true, | ||
}, | ||
successMessage: 'Account created successfully.', | ||
loginButtonText: 'Back to Login', | ||
inputs: [ | ||
{ | ||
name: 'name', | ||
label: 'Name', | ||
placeholder: 'Name', | ||
validation: string().required(), | ||
}, | ||
{ | ||
name: 'email', | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'email', | ||
validation: string().email().required(), | ||
}, | ||
{ | ||
name: 'password', | ||
label: 'Password', | ||
placeholder: 'Password', | ||
type: 'password', | ||
validation: string().required(), | ||
}, | ||
{ | ||
name: 'password_confirmation', | ||
label: 'Password Confirmation', | ||
placeholder: 'Password Confirmation', | ||
type: 'password', | ||
validation: string() | ||
.required() | ||
.oneOf([YupRef('password')], 'Password does not match'), | ||
}, | ||
{ | ||
name: 'agree_to_toc', | ||
label: 'Agree to Terms and Conditions', | ||
component: 'checkbox', | ||
validation: boolean().required(), | ||
}, | ||
], | ||
}, | ||
forgotPassword: { | ||
logo: true, | ||
head: { | ||
title: 'Forgot Password', | ||
}, | ||
title: 'Forgot Password', | ||
description: 'Enter your email address to reset your password.', | ||
buttonText: 'Reset Password', | ||
loginButtonText: 'Login', | ||
successMessage: 'Password reset email sent.', | ||
inputProps: { | ||
name: 'email', | ||
label: 'Email', | ||
placeholder: 'Email', | ||
type: 'email', | ||
}, | ||
buttonProps: { | ||
type: 'submit', | ||
color: 'primary', | ||
block: true, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.