@@ -9,13 +9,13 @@ import (
99// SignInWithOTP sign in with email and otp.
1010func (a * Auth ) SignInWithOTP (ctx context.Context , email , otp string ) (Session , error ) {
1111
12- id , err := a .getUserIDByEmail (ctx , email )
12+ u , err := a .getUserByEmail (ctx , email )
1313
1414 if err != nil {
1515 return noSession , ErrEmailNotFound
1616 }
1717
18- pd , err := a .getUserProfileData (ctx , id )
18+ pd , err := a .getUserProfileData (ctx , u . ID )
1919 if err != nil {
2020 return noSession , err
2121 }
@@ -24,19 +24,19 @@ func (a *Auth) SignInWithOTP(ctx context.Context, email, otp string) (Session, e
2424 return noSession , ErrOTPNotMatched
2525 }
2626
27- return a .createSession (ctx , id )
27+ return a .createSession (ctx , u . ID , u . FirstName , u . LastName )
2828
2929}
3030
3131// SignInMobileWithOTP sign in with mobile and otp.
3232func (a * Auth ) SignInMobileWithOTP (ctx context.Context , mobile , otp string ) (Session , error ) {
33- id , err := a .getUserIDByMobile (ctx , mobile )
33+ u , err := a .getUserByMobile (ctx , mobile )
3434
3535 if err != nil {
3636 return noSession , ErrMobileNotFound
3737 }
3838
39- pd , err := a .getUserProfileData (ctx , id )
39+ pd , err := a .getUserProfileData (ctx , u . ID )
4040 if err != nil {
4141 return noSession , err
4242 }
@@ -45,5 +45,5 @@ func (a *Auth) SignInMobileWithOTP(ctx context.Context, mobile, otp string) (Ses
4545 return noSession , ErrOTPNotMatched
4646 }
4747
48- return a .createSession (ctx , id )
48+ return a .createSession (ctx , u . ID , u . FirstName , u . LastName )
4949}
0 commit comments