forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forgot password methods (bluesky-social#216)
* Schemas and scaffolding for reset password methods * Initial handler for todo.adx.requestAccountPasswordReset * Initial handler for todo.adx.resetAccountPassword * Implement server mailer * Configure server for mailer and testing w/ mailer * Test happy path of pass reset, fix reset bug * Update lex to fix types bug for requestAccountPasswordReset * Fix handlebars reference to config getters * Test some negative password reset flows * Minor cleanup to pass reset * Tidy handlebars file with prettier, supporting double-quotes for html * Fix esbuild of server for mailer templates, fix test issue * Misc tidying for password reset * Misc tidying for password reset
- Loading branch information
Showing
30 changed files
with
966 additions
and
95 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
29 changes: 29 additions & 0 deletions
29
packages/api/src/types/todo/adx/requestAccountPasswordReset.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { Headers, XRPCError } from '@adxp/xrpc' | ||
|
||
export interface QueryParams {} | ||
|
||
export interface CallOptions { | ||
headers?: Headers; | ||
encoding: 'application/json'; | ||
} | ||
|
||
export interface InputSchema { | ||
email: string; | ||
} | ||
|
||
export interface OutputSchema {} | ||
|
||
export interface Response { | ||
success: boolean; | ||
headers: Headers; | ||
data: OutputSchema; | ||
} | ||
|
||
export function toKnownErr(e: any) { | ||
if (e instanceof XRPCError) { | ||
} | ||
return e | ||
} |
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,44 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { Headers, XRPCError } from '@adxp/xrpc' | ||
|
||
export interface QueryParams {} | ||
|
||
export interface CallOptions { | ||
headers?: Headers; | ||
encoding: 'application/json'; | ||
} | ||
|
||
export interface InputSchema { | ||
token: string; | ||
password: string; | ||
} | ||
|
||
export interface OutputSchema {} | ||
|
||
export interface Response { | ||
success: boolean; | ||
headers: Headers; | ||
data: OutputSchema; | ||
} | ||
|
||
export class ExpiredTokenError extends XRPCError { | ||
constructor(src: XRPCError) { | ||
super(src.status, src.error, src.message) | ||
} | ||
} | ||
|
||
export class InvalidTokenError extends XRPCError { | ||
constructor(src: XRPCError) { | ||
super(src.status, src.error, src.message) | ||
} | ||
} | ||
|
||
export function toKnownErr(e: any) { | ||
if (e instanceof XRPCError) { | ||
if (e.error === 'ExpiredToken') return new ExpiredTokenError(e) | ||
if (e.error === 'InvalidToken') return new InvalidTokenError(e) | ||
} | ||
return e | ||
} |
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 |
---|---|---|
|
@@ -78,7 +78,12 @@ export class DevEnvServer { | |
serverDid: serverDid, | ||
testNameRegistry: this.env.testNameRegistry, | ||
jwtSecret: crytpo.randomBytes(8).toString('base64'), | ||
}), | ||
appUrlPasswordReset: 'app://password-reset', | ||
// @TODO setup ethereal.email creds and set emailSmtpUrl here | ||
emailNoReplyAddress: '[email protected]', | ||
adminPassword: 'password', | ||
inviteRequired: false, | ||
}).listener, | ||
) | ||
break | ||
} | ||
|
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
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
Oops, something went wrong.