Redirect when already authenticated
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -616,9 +616,9 @@ type Query {
|
||||
|
||||
type Mutation {
|
||||
sendMagicLink(input: SendMagicLinkInput!): SendMagicLinkPayload
|
||||
@session(required: OPTIONAL)
|
||||
@session(required: NONE)
|
||||
verifyMagicLink(input: VerifyMagicLinkInput!): VerifyMagicLinkPayload
|
||||
@session(required: OPTIONAL)
|
||||
@session(required: NONE)
|
||||
|
||||
requestAllAccesses: RequestAccessesPayload! @session(required: PRESENT)
|
||||
|
||||
|
||||
@@ -1854,9 +1854,9 @@ type Query {
|
||||
|
||||
type Mutation {
|
||||
sendMagicLink(input: SendMagicLinkInput!): SendMagicLinkPayload
|
||||
@session(required: OPTIONAL)
|
||||
@session(required: NONE)
|
||||
verifyMagicLink(input: VerifyMagicLinkInput!): VerifyMagicLinkPayload
|
||||
@session(required: OPTIONAL)
|
||||
@session(required: NONE)
|
||||
|
||||
requestAllAccesses: RequestAccessesPayload! @session(required: PRESENT)
|
||||
|
||||
@@ -3203,7 +3203,7 @@ func (ec *executionContext) _Mutation_sendMagicLink(ctx context.Context, field g
|
||||
directive0 := next
|
||||
|
||||
directive1 := func(ctx context.Context) (any, error) {
|
||||
required, err := ec.unmarshalNSessionRequirement2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋgqlutilsᚋdirectivesᚋsessionᚐSessionRequirement(ctx, "OPTIONAL")
|
||||
required, err := ec.unmarshalNSessionRequirement2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋgqlutilsᚋdirectivesᚋsessionᚐSessionRequirement(ctx, "NONE")
|
||||
if err != nil {
|
||||
var zeroVal *types.SendMagicLinkPayload
|
||||
return zeroVal, err
|
||||
@@ -3266,7 +3266,7 @@ func (ec *executionContext) _Mutation_verifyMagicLink(ctx context.Context, field
|
||||
directive0 := next
|
||||
|
||||
directive1 := func(ctx context.Context) (any, error) {
|
||||
required, err := ec.unmarshalNSessionRequirement2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋgqlutilsᚋdirectivesᚋsessionᚐSessionRequirement(ctx, "OPTIONAL")
|
||||
required, err := ec.unmarshalNSessionRequirement2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋgqlutilsᚋdirectivesᚋsessionᚐSessionRequirement(ctx, "NONE")
|
||||
if err != nil {
|
||||
var zeroVal *types.VerifyMagicLinkPayload
|
||||
return zeroVal, err
|
||||
|
||||
@@ -153,11 +153,6 @@ func (r *frameworkResolver) DarkLogoURL(ctx context.Context, obj *types.Framewor
|
||||
|
||||
// SendMagicLink is the resolver for the sendMagicLink field.
|
||||
func (r *mutationResolver) SendMagicLink(ctx context.Context, input types.SendMagicLinkInput) (*types.SendMagicLinkPayload, error) {
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
if identity != nil {
|
||||
return nil, gqlutils.AlreadyAuthenticatedf(ctx, "already authenticated")
|
||||
}
|
||||
|
||||
trustCenter := compliancepage.CompliancePageFromContext(ctx)
|
||||
|
||||
req := &iam.SendMagicLinkRequest{
|
||||
|
||||
Reference in New Issue
Block a user