-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(providers): make
issuer
configurable on Salesforce (#4658)
- Loading branch information
1 parent
0a7a916
commit 358b80d
Showing
2 changed files
with
32 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
import type { OAuthConfig, OAuthUserConfig } from "." | ||
|
||
export interface SalesforceProfile extends Record<string, any> { | ||
sub: string | ||
nickname: string | ||
email: string | ||
picture: string | ||
} | ||
|
||
export default function Salesforce<P extends SalesforceProfile>( | ||
options: OAuthUserConfig<P> | ||
): OAuthConfig<P> { | ||
const { issuer = "https://login.salesforce.com" } = options | ||
return { | ||
id: "salesforce", | ||
name: "Salesforce", | ||
type: "oauth", | ||
authorization: `${issuer}/services/oauth2/authorize?display=page`, | ||
token: `${issuer}/services/oauth2/token`, | ||
userinfo: `${issuer}/services/oauth2/userinfo`, | ||
profile(profile) { | ||
return { | ||
id: profile.user_id, | ||
name: null, | ||
email: null, | ||
image: profile.picture, | ||
} | ||
}, | ||
checks: ["none"], | ||
options, | ||
} | ||
} |
358b80d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what happened, but all my apps using this code stopped working, throwing this error: