Merged in feature/curity-social-login (pull request #2963)
feat(SW-3541): Do social login after login to SAS * feat(auth): wip social login via curity * Setup social login auth flow * Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/curity-social-login * Added support for getting scandic tokens and refresh them * feat: Enhance social login and session management with auto-refresh and improved error handling * Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/curity-social-login * wrap layout in suspense * revert app/layout.tsx * fix import * cleanup * merge * merge * dont pass client_secret in the url to curity * add state validation when doing social login through /authorize * remove debug logging Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -11,7 +11,10 @@ export async function getUserPointsBalance(
|
||||
|
||||
const verifiedUser =
|
||||
session.token.loginType === "sas"
|
||||
? await getEuroBonusProfileData(session)
|
||||
? await getEuroBonusProfileData({
|
||||
accessToken: session.token.access_token,
|
||||
loginType: session.token.loginType,
|
||||
})
|
||||
: await getVerifiedUser({ session })
|
||||
|
||||
if (!verifiedUser || "error" in verifiedUser) {
|
||||
@@ -19,8 +22,8 @@ export async function getUserPointsBalance(
|
||||
}
|
||||
|
||||
const points =
|
||||
"points" in verifiedUser.data
|
||||
? verifiedUser.data.points.total
|
||||
"points" in verifiedUser
|
||||
? verifiedUser.points.total
|
||||
: verifiedUser.data.membership?.currentPoints
|
||||
|
||||
return points ?? 0
|
||||
|
||||
Reference in New Issue
Block a user