@@ -18,7 +18,7 @@ export class InvalidMethod extends Error {}
1818export class MissingRequiredField extends Error { }
1919export class RemoteError extends Error { }
2020
21- export type TurnstileMagicLinkStrategyOptions = {
21+ export type RfdMagicLinkStrategyOptions = {
2222 storage : SessionStorage
2323 host : string
2424 clientSecret : string
@@ -32,21 +32,21 @@ export type TurnstileMagicLinkStrategyOptions = {
3232 scope ?: RfdScope [ ]
3333}
3434
35- export type TurnstileMagicLinkVerifyParams = {
35+ export type RfdMagicLinkVerifyParams = {
3636 attemptId : string
3737 email : string
3838 user : GetUserResponse_for_RfdPermission
3939 token : string
4040}
4141
42- export class TurnstileMagicLinkStrategy < User > extends Strategy < User , TurnstileMagicLinkVerifyParams > {
42+ export class RfdMagicLinkStrategy < User > extends Strategy < User , RfdMagicLinkVerifyParams > {
4343 public name = 'rfd-magic-link'
4444
4545 // Session based storage to use for storing the client side authentication materials
4646 // for tracking the authentication flow
4747 private readonly storage : SessionStorage
4848
49- // Turnstile server to perform authentication against
49+ // Rfd server to perform authentication against
5050 private readonly host : string
5151
5252 // Client secret that will be used to exchange magic link codes for user information
@@ -73,11 +73,11 @@ export class TurnstileMagicLinkStrategy<User> extends Strategy<User, TurnstileMa
7373 private readonly sessionAttemptKey : string = 'auth:v-ml:attempt'
7474 private readonly sessionEmailKey : string = 'auth:v-ml:email'
7575
76- protected verify : Strategy . VerifyFunction < User , TurnstileMagicLinkVerifyParams >
76+ protected verify : Strategy . VerifyFunction < User , RfdMagicLinkVerifyParams >
7777
7878 constructor (
79- options : TurnstileMagicLinkStrategyOptions ,
80- verify : Strategy . VerifyFunction < User , TurnstileMagicLinkVerifyParams > ,
79+ options : RfdMagicLinkStrategyOptions ,
80+ verify : Strategy . VerifyFunction < User , RfdMagicLinkVerifyParams > ,
8181 ) {
8282 super ( verify )
8383 this . verify = verify
@@ -151,7 +151,7 @@ export class TurnstileMagicLinkStrategy<User> extends Strategy<User, TurnstileMa
151151 session . set ( this . sessionAttemptKey , attemptId )
152152 session . set ( this . sessionEmailKey , email )
153153 } catch ( err ) {
154- console . error ( 'Turnstile server failed to send magic link email' , err )
154+ console . error ( 'RFD server failed to send magic link email' , err )
155155 throw new RemoteError ( 'Failed to send magic link email' )
156156 }
157157
0 commit comments