This repository has been archived by the owner on May 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create oidc auth middleware * Auth user info (#178) * add docs and basic signin UI * Update README.md * Update README.md * Refactor authn config (#180) * Refactor authn config * address comments * Improve authn visuals (#181) * Improve authn visuals Co-authored-by: swyx <shawnthe1@gmail.com> * Memoize web config (#182) * Delete config.yml.example * Update README.md * Update server/config.yml * Update server/config.yml * Update README.md * Update README.md Co-authored-by: swyx <shawnthe1@gmail.com> * Integrate auth tokens into temporal server connection (#184) Co-authored-by: swyx <wanshawn@amazon.com> Co-authored-by: swyx <shawnthe1@gmail.com>
- Loading branch information
1 parent
1bc811a
commit 08b6499
Showing
18 changed files
with
1,046 additions
and
187 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,110 @@ | ||
<template> | ||
<section class="signin"> | ||
<div class="signin-form"> | ||
<img | ||
:src="currentUser ? currentUser.picture : temporalLogo" | ||
alt="user pic" | ||
class="avatar" | ||
/> | ||
<div> | ||
<dl v-if="currentUser" class="user-details"> | ||
<dd> | ||
<b>{{ currentUser.name }}</b> | ||
</dd> | ||
<dd v-if="currentUser.name !== currentUser.email"> | ||
{{ currentUser.email }} | ||
</dd> | ||
</dl> | ||
<h2 v-else class="vert-space-4"><b>Sign in to Temporal</b></h2> | ||
</div> | ||
<div class="vert-space-4"> | ||
<button | ||
class="close icon icon_delete" | ||
@click="logout" | ||
v-if="currentUser" | ||
> | ||
Sign Out | ||
</button> | ||
<button class="close icon icon_key" @click="oidc" v-else> | ||
Continue to SSO | ||
</button> | ||
</div> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<script> | ||
import temporalLogo from '../assets/logo-rounded.png'; | ||
import { NavigationLink } from '~components'; | ||
export default { | ||
name: 'signin', | ||
data() { | ||
return { currentUser: false, temporalLogo }; | ||
}, | ||
async created() { | ||
const me = await this.$http('/api/me'); | ||
this.currentUser = me.user; | ||
}, | ||
methods: { | ||
async logout() { | ||
window.location.assign('/auth/logout'); | ||
}, | ||
async oidc() { | ||
try { | ||
window.location.assign('/auth/sso'); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="stylus"> | ||
@require '../styles/definitions.styl'; | ||
.vert-space-4 { | ||
margin-top : 20px | ||
} | ||
.signin { | ||
display: flex | ||
justify-content: center | ||
align-items: center | ||
.user-details { | ||
dd { | ||
width: 100%; | ||
text-align: center; | ||
} | ||
} | ||
.signin-form { | ||
padding: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
border: 1px solid #d8dee2; | ||
width: 380px; | ||
align-items: center | ||
div { | ||
width: 100%; | ||
display: flex | ||
justify-content: center | ||
align-items: center | ||
} | ||
.avatar { | ||
width: 6rem | ||
height : 6rem | ||
border-radius : 500rem | ||
padding: 1rem | ||
} | ||
button{ | ||
width: 100% | ||
height: 40px | ||
} | ||
} | ||
} | ||
</style> |
Oops, something went wrong.