Skip to content

Commit

Permalink
util/api.js: Add createWithIdp endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
OtterleyW committed Oct 1, 2020
1 parent ade859f commit 85bec53
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/util/api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// These helpers are calling FTW's own server-side routes
// and nor directly calling Marketplace API or Integration API
// You can find these api endpoints from 'server/api/...' directory

import { types as sdkTypes, transit } from './sdkLoader';
import config from '../config';
import Decimal from 'decimal.js';
Expand Down Expand Up @@ -98,3 +102,16 @@ export const initiatePrivileged = body => {
export const transitionPrivileged = body => {
return post('/api/transition-privileged', body);
};

// Create user with identity provider (e.g. Facebook or Google)
//
// If loginWithIdp api call fails and user can't authenticate to Flex with idp
// we will show option to create a new user with idp.
// For that user needs to confirm data fetched from the idp.
// After the confrimation, this endpoint is called to create a new user with confirmed data.
//
// See `server/api/auth/createUserWithIdp.js` to see what data should
// be sent in the body.
export const createUserWithIdp = body => {
return post('/api/auth/create-user-with-idp', body);
};

0 comments on commit 85bec53

Please sign in to comment.