mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
Support password reset workflow on Webatrice (#4445)
* Support password reset workflow. Also fix issue where a user would be disconnected "randomly" if they had a failed login, then successful one. Refactored a bit on Status Labels since they weren't really necessary and added complexity. * Disconnect in default cases where we don't know what to do, but shouldn't stay connected to the server
This commit is contained in:
parent
013bb8269f
commit
ac300b0b6d
10 changed files with 189 additions and 77 deletions
|
|
@ -15,12 +15,24 @@ export default class AuthenticationService {
|
|||
SessionCommands.connect(options, WebSocketConnectReason.ACTIVATE_ACCOUNT);
|
||||
}
|
||||
|
||||
static resetPasswordRequest(options: WebSocketOptions): void {
|
||||
SessionCommands.connect(options, WebSocketConnectReason.PASSWORD_RESET_REQUEST);
|
||||
}
|
||||
|
||||
static resetPasswordChallenge(options: WebSocketOptions): void {
|
||||
SessionCommands.connect(options, WebSocketConnectReason.PASSWORD_RESET_CHALLENGE);
|
||||
}
|
||||
|
||||
static resetPassword(options: WebSocketOptions): void {
|
||||
SessionCommands.connect(options, WebSocketConnectReason.PASSWORD_RESET);
|
||||
}
|
||||
|
||||
static disconnect(): void {
|
||||
SessionCommands.disconnect();
|
||||
}
|
||||
|
||||
static isConnected(state: number): boolean {
|
||||
return state === StatusEnum.LOGGEDIN;
|
||||
return state === StatusEnum.LOGGED_IN;
|
||||
}
|
||||
|
||||
static isModerator(user: User): boolean {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue