{"action":"created","issue":{"url":"https://api.github.com/repos/laardee/serverless-authentication-boilerplate/issues/7","repository_url":"https://api.github.com/repos/laardee/serverless-authentication-boilerplate","labels_url":"https://api.github.com/repos/laardee/serverless-authentication-boilerplate/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/laardee/serverless-authentication-boilerplate/issues/7/comments","events_url":"https://api.github.com/repos/laardee/serverless-authentication-boilerplate/issues/7/events","html_url":"https://github.com/laardee/serverless-authentication-boilerplate/issues/7","id":151101576,"number":7,"title":"How to redirect to originating page?","user":{"login":"rentrop","id":9575579,"avatar_url":"https://avatars.githubusercontent.com/u/9575579?v=3","gravatar_id":"","url":"https://api.github.com/users/rentrop","html_url":"https://github.com/rentrop","followers_url":"https://api.github.com/users/rentrop/followers","following_url":"https://api.github.com/users/rentrop/following{/other_user}","gists_url":"https://api.github.com/users/rentrop/gists{/gist_id}","starred_url":"https://api.github.com/users/rentrop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rentrop/subscriptions","organizations_url":"https://api.github.com/users/rentrop/orgs","repos_url":"https://api.github.com/users/rentrop/repos","events_url":"https://api.github.com/users/rentrop/events{/privacy}","received_events_url":"https://api.github.com/users/rentrop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-26T10:47:34Z","updated_at":"2016-04-26T12:07:05Z","closed_at":null,"body":"Is there a way to redirect the user to his/her current position?\r\n\r\nE.g. The user is on /cars. After he logs in i want him to be end up on /cars again.\r\nIf he is on /watches i want him to be redirected to /watches.\r\n\r\nAs far as i understand \r\n```\r\n\"redirectClientURI\": \"http://url-to-frontend-webapp/\"\r\n```\r\ndetermins the redirect URI. How can i make something like `\"redirectClientURI\": \"origin\"` work?"},"comment":{"url":"https://api.github.com/repos/laardee/serverless-authentication-boilerplate/issues/comments/214718826","html_url":"https://github.com/laardee/serverless-authentication-boilerplate/issues/7#issuecomment-214718826","issue_url":"https://api.github.com/repos/laardee/serverless-authentication-boilerplate/issues/7","id":214718826,"user":{"login":"laardee","id":4726921,"avatar_url":"https://avatars.githubusercontent.com/u/4726921?v=3","gravatar_id":"","url":"https://api.github.com/users/laardee","html_url":"https://github.com/laardee","followers_url":"https://api.github.com/users/laardee/followers","following_url":"https://api.github.com/users/laardee/following{/other_user}","gists_url":"https://api.github.com/users/laardee/gists{/gist_id}","starred_url":"https://api.github.com/users/laardee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laardee/subscriptions","organizations_url":"https://api.github.com/users/laardee/orgs","repos_url":"https://api.github.com/users/laardee/repos","events_url":"https://api.github.com/users/laardee/events{/privacy}","received_events_url":"https://api.github.com/users/laardee/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T12:07:05Z","updated_at":"2016-04-26T12:07:05Z","body":"Maybe you could map header referer and use that as a redirectClientURI. \r\n\r\nHere is a small example: \r\nhttps://jsfiddle.net/9t9kysaz/\r\n\r\nIn the Api Gateway I've mapped origin and referer (requestTemplates in s-function.json) \r\n\r\n```\r\n{\r\n    \"origin\": \"$input.params().header.origin\",\r\n    \"referer\": \"$input.params().header.referer\"\r\n}\r\n```\r\n\r\nAnd then I have simple Lambda function that returns mapped data\r\n```\r\nexports.handler = function(event, context) {\r\n    context.succeed(event);\r\n};\r\n```\r\n"}}