blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

[Feature Request] Possible to make anonymous session at passportAuth #383

Closed kyoungduck closed 2 years ago

kyoungduck commented 2 years ago

What do you want and why?

I want to make anonymous session at passportAdapter. For now, I can only return error or publicData to passport done callback. But I just want to make anonymous session(private session).

Because I need to get user information after third party authorized. For example, when I try to implement "Login with blizzard account" I can use passport-bnet but, blizzard never give me the user's email. So I need to get email from use after blizzard authentication finished. So I try to set blizzard auth information to anonymous session. But for now, I can't put null to userId(if userId is null, I must give exception to callback first argument). image

Possible implementation(s)

Make possible like this.

done(null, { privateData:{}, redirectUrl: "REDIRECT_URL" })

I think it must fix VerifyCallbackResult type.

export type VerifyCallbackResult = {
  publicData?: PublicData
  privateData?: Record<string, any>
  redirectUrl?: string
}

Additional context

I was talking about this at Discord. link

beerose commented 2 years ago

I'm going to close this issue and move the discussion back to Discord.