Organize components, switch auth to not use session

This commit is contained in:
Jai A
2021-03-30 21:38:12 -07:00
parent 464f336790
commit e61a1080f7
36 changed files with 111 additions and 869 deletions

View File

@@ -6,10 +6,14 @@ export default async function (context) {
}
if (context.route.query.code) {
const date = new Date()
date.setFullYear(new Date().getFullYear() + 1)
context.app.$cookies.set('auth-token', context.route.query.code, {
secure: true,
sameSite: 'Strict',
httpOnly: true,
expires: date,
})
await context.store.dispatch('auth/fetchUser', {
@@ -32,7 +36,7 @@ export default async function (context) {
if (!context.$auth.user) {
return context.redirect(
`https://api.modrinth.com/api/v1/auth/init?url=https://modrinth.com${context.route.fullPath}`
`https://api.modrinth.com/api/v1/auth/init?url=https://modrinth.com${context.route.path}`
)
}
}