-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added email verification to signup workflow, integrated auth api from…
… backend. (#153) * Added email verification to signup workflow, integrated auth api from backend. Now frontend just needs to call createNewUser() from src/services/AuthService to start the signup workflow, then finishes it off with email verif. being handled in frontend. * Added try catch for calls to a firebase service in signup's handleSubmit. * Fixed duplicate imports in SignUpPage.
- Loading branch information
1 parent
2259743
commit 0f32248
Showing
11 changed files
with
277 additions
and
31 deletions.
There are no files selected for viewing
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
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
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,14 @@ | ||
import { AuthApi, AuthControllerSignUpUserRequest } from './api/apis/AuthApi'; | ||
import { AppUserSignupRequest, AppUserResponse } from './api/models'; | ||
import ApiConfigStore from './ApiConfigStore'; | ||
import { Configuration } from './api/runtime'; | ||
|
||
export async function createNewUser( | ||
appUserSignupRequest: AppUserSignupRequest | ||
): Promise<AppUserResponse> { | ||
const apiConfig: Configuration = ApiConfigStore.getApiConfig(); | ||
const authApi: AuthApi = new AuthApi(apiConfig); | ||
const request: AuthControllerSignUpUserRequest = { appUserSignupRequest }; | ||
|
||
return authApi.authControllerSignUpUser(request); | ||
} |
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 |
---|---|---|
@@ -1,26 +1,28 @@ | ||
apis\EventApi.ts | ||
apis\UserApi.ts | ||
apis\index.ts | ||
apis/AuthApi.ts | ||
apis/EventApi.ts | ||
apis/UserApi.ts | ||
apis/index.ts | ||
index.ts | ||
models\AppUserEventRequest.ts | ||
models\AppUserEventResponse.ts | ||
models\AppUserInductionClass.ts | ||
models\AppUserNameResponse.ts | ||
models\AppUserPKPayload.ts | ||
models\AppUserPostRequest.ts | ||
models\AppUserProfileResponse.ts | ||
models\AppUserResponse.ts | ||
models\AppUserRolesResponse.ts | ||
models\AttendanceResponse.ts | ||
models\BaseEventPayload.ts | ||
models\EventAttendanceResponse.ts | ||
models\EventRSVPResponse.ts | ||
models\EventRequest.ts | ||
models\EventResponse.ts | ||
models\MultipleAppUserResponse.ts | ||
models\MultipleEventResponse.ts | ||
models\MultipleUserNameResponse.ts | ||
models\MultipleUserQuery.ts | ||
models\RSVPResponse.ts | ||
models\index.ts | ||
models/AppUserEventRequest.ts | ||
models/AppUserEventResponse.ts | ||
models/AppUserInductionClass.ts | ||
models/AppUserNameResponse.ts | ||
models/AppUserPKPayload.ts | ||
models/AppUserPostRequest.ts | ||
models/AppUserProfileResponse.ts | ||
models/AppUserResponse.ts | ||
models/AppUserRolesResponse.ts | ||
models/AppUserSignupRequest.ts | ||
models/AttendanceResponse.ts | ||
models/BaseEventPayload.ts | ||
models/EventAttendanceResponse.ts | ||
models/EventRSVPResponse.ts | ||
models/EventRequest.ts | ||
models/EventResponse.ts | ||
models/MultipleAppUserResponse.ts | ||
models/MultipleEventResponse.ts | ||
models/MultipleUserNameResponse.ts | ||
models/MultipleUserQuery.ts | ||
models/RSVPResponse.ts | ||
models/index.ts | ||
runtime.ts |
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 |
---|---|---|
@@ -1 +1 @@ | ||
5.0.0-beta | ||
5.0.0-beta2 |
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,67 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* HKN API | ||
* HKN API | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
import * as runtime from '../runtime'; | ||
import { | ||
AppUserResponse, | ||
AppUserResponseFromJSON, | ||
AppUserResponseToJSON, | ||
AppUserSignupRequest, | ||
AppUserSignupRequestFromJSON, | ||
AppUserSignupRequestToJSON, | ||
} from '../models'; | ||
|
||
export interface AuthControllerSignUpUserRequest { | ||
appUserSignupRequest?: AppUserSignupRequest; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
export class AuthApi extends runtime.BaseAPI { | ||
/** | ||
* Sign up user | ||
*/ | ||
async authControllerSignUpUserRaw( | ||
requestParameters: AuthControllerSignUpUserRequest | ||
): Promise<runtime.ApiResponse<AppUserResponse>> { | ||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request({ | ||
path: `/api/auth/signup`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: AppUserSignupRequestToJSON(requestParameters.appUserSignupRequest), | ||
}); | ||
|
||
return new runtime.JSONApiResponse(response, jsonValue => | ||
AppUserResponseFromJSON(jsonValue) | ||
); | ||
} | ||
|
||
/** | ||
* Sign up user | ||
*/ | ||
async authControllerSignUpUser( | ||
requestParameters: AuthControllerSignUpUserRequest | ||
): Promise<AppUserResponse> { | ||
const response = await this.authControllerSignUpUserRaw(requestParameters); | ||
return await response.value(); | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './AuthApi'; | ||
export * from './EventApi'; | ||
export * from './UserApi'; |
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
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,98 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* HKN API | ||
* HKN API | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
import { exists, mapValues } from '../runtime'; | ||
/** | ||
* | ||
* @export | ||
* @interface AppUserSignupRequest | ||
*/ | ||
export interface AppUserSignupRequest { | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof AppUserSignupRequest | ||
*/ | ||
email: string; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof AppUserSignupRequest | ||
*/ | ||
firstName: string; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof AppUserSignupRequest | ||
*/ | ||
lastName: string; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof AppUserSignupRequest | ||
*/ | ||
major: string; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof AppUserSignupRequest | ||
*/ | ||
graduationYear: string; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof AppUserSignupRequest | ||
*/ | ||
password: string; | ||
} | ||
|
||
export function AppUserSignupRequestFromJSON(json: any): AppUserSignupRequest { | ||
return AppUserSignupRequestFromJSONTyped(json, false); | ||
} | ||
|
||
export function AppUserSignupRequestFromJSONTyped( | ||
json: any, | ||
ignoreDiscriminator: boolean | ||
): AppUserSignupRequest { | ||
if (json === undefined || json === null) { | ||
return json; | ||
} | ||
return { | ||
email: json['email'], | ||
firstName: json['firstName'], | ||
lastName: json['lastName'], | ||
major: json['major'], | ||
graduationYear: json['graduationYear'], | ||
password: json['password'], | ||
}; | ||
} | ||
|
||
export function AppUserSignupRequestToJSON( | ||
value?: AppUserSignupRequest | null | ||
): any { | ||
if (value === undefined) { | ||
return undefined; | ||
} | ||
if (value === null) { | ||
return null; | ||
} | ||
return { | ||
email: value.email, | ||
firstName: value.firstName, | ||
lastName: value.lastName, | ||
major: value.major, | ||
graduationYear: value.graduationYear, | ||
password: value.password, | ||
}; | ||
} |
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