mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Return username when registration is completed
This commit is contained in:
parent
fa2e2bc8f3
commit
792d5c62c5
@ -43,10 +43,10 @@ export abstract class BaseRegistrationStage {
|
||||
/**
|
||||
* Finish a registration stage, return value is:
|
||||
* - the next stage if this stage was completed successfully
|
||||
* - true if registration is completed
|
||||
* - user-id (string) if registration is completed
|
||||
* - an error if something went wrong
|
||||
*/
|
||||
abstract complete(auth?: Auth): Promise<BaseRegistrationStage | Error | true>;
|
||||
abstract complete(auth?: Auth): Promise<BaseRegistrationStage | Error | string>;
|
||||
|
||||
setNextStage(stage: BaseRegistrationStage) {
|
||||
this._nextStage = stage;
|
||||
@ -55,7 +55,7 @@ export abstract class BaseRegistrationStage {
|
||||
parseResponse(response: RegistrationResponse) {
|
||||
if (response.user_id) {
|
||||
// registration completed successfully
|
||||
return true;
|
||||
return response.user_id;
|
||||
}
|
||||
else if (response.completed?.find(c => c === this.type)) {
|
||||
return this._nextStage;
|
||||
|
Loading…
Reference in New Issue
Block a user