-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added in working magic link implementation
included mailcatcher, email templates, kickstart config. all you have to do as a user is enable magic links on the application
- Loading branch information
Showing
5 changed files
with
107 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[#setting url_escaping_charset="UTF-8"] | ||
You have requested to log into ChangeBank using this email address. If you do not recognize this request please ignore this email. | ||
<p> | ||
[#-- The optional 'state' map provided on the Start Passwordless API call is exposed in the template as 'state' --] | ||
[#assign url = "http://localhost:9011/oauth2/passwordless/${code}?postMethod=true&tenantId=${user.tenantId}" /] | ||
[#list state!{} as key, value][#if key != "tenantId" && value??][#assign url = url + "&" + key?url + "=" + value?url/][/#if][/#list] | ||
<a href="${url}">${url}</a> | ||
</p> | ||
- ChangeBank Admin |
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,10 @@ | ||
[#setting url_escaping_charset="UTF-8"] | ||
You have requested to log into ChangeBank using this email address. If you do not recognize this request please ignore this email. | ||
|
||
[#-- The optional 'state' map provided on the Start Passwordless API call is exposed in the template as 'state' --] | ||
[#assign url = "http://localhost:9011/oauth2/passwordless/${code}?postMethod=true&tenantId=${user.tenantId}" /] | ||
[#list state!{} as key, value][#if key != "tenantId" && value??][#assign url = url + "&" + key?url + "=" + value?url/][/#if][/#list] | ||
|
||
${url} | ||
|
||
- ChangeBank Admin |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"applicationId": "e9fdb985-9173-4e01-9d73-ac2d60d1dc8e", | ||
"clientSecret": "super-secret-secret-that-should-be-regenerated-for-production", | ||
"newThemeId": "#{UUID()}", | ||
"magicLinkTemplateId": "#{UUID()}", | ||
"defaultTenantId": "d7d09513-a3f5-401c-9685-34ab6c552453", | ||
"adminEmail": "[email protected]", | ||
"adminPassword": "password", | ||
|
@@ -38,7 +39,7 @@ | |
"tenantId": "#{defaultTenantId}", | ||
"body": { | ||
"application": { | ||
"name": "ExampleNodeApp", | ||
"name": "Start Here App", | ||
"oauthConfiguration": { | ||
"authorizedRedirectURLs": [ | ||
"http://localhost:8080/oauth-redirect" | ||
|
@@ -111,7 +112,7 @@ | |
"body": { | ||
"sourceThemeId": "75a068fd-e94b-451a-9aeb-3ddb9a3b5987", | ||
"theme": { | ||
"name": "React theme" | ||
"name": "Start here theme" | ||
} | ||
} | ||
}, | ||
|
@@ -132,6 +133,43 @@ | |
"themeId": "#{newThemeId}" | ||
} | ||
} | ||
}, | ||
{ | ||
"method": "PATCH", | ||
"url": "/api/tenant/#{defaultTenantId}", | ||
"body": { | ||
"tenant": { | ||
"emailConfiguration": { | ||
"host": "mailcatcher", | ||
"port": 1025 | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"method": "POST", | ||
"url": "/api/email/template/#{magicLinkTemplateId}", | ||
"body": { | ||
"emailTemplate": { | ||
"defaultFromName": "No Reply", | ||
"defaultSubject": "Log in", | ||
"defaultHtmlTemplate": "@{email-templates/magic-link.html}", | ||
"defaultTextTemplate": "@{email-templates/magic-link.txt}", | ||
"fromEmail": "[email protected]", | ||
"name": "Magic Link Login" | ||
} | ||
} | ||
}, | ||
{ | ||
"method": "PATCH", | ||
"url": "/api/tenant/#{defaultTenantId}", | ||
"body": { | ||
"tenant": { | ||
"emailConfiguration": { | ||
"passwordlessEmailTemplateId": "#{magicLinkTemplateId}" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |