You've already forked AstralRinth
forked from didirus/AstralRinth
Organize components, switch auth to not use session
This commit is contained in:
@@ -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}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user