Custom login component methods
getUser
This method returns the JWT and other relevant information about the user's authenticated session.
Example
const user = window.wyng["_WYNG_ID_"].getUser();
console.log(user);
Potential Output
{
"userInfo": {
"sub": "74b8c4c8-xxxx-xxxx-xxxx-27fd52ce6e9c",
"email_verified": true,
"email": "joe.bloggs@example.com",
"username": "74b8c4c8-xxxx-xxxx-xxxx-27fd52ce6e9c",
"profile": {
"consumerIdentity": {
"firstName": "Joe",
"lastName": "Bloggs",
"middleName": "Anothony",
"preferredName": "Joe",
"familyNameOfBirth": "Bloggs",
"honorificPrefix": "Mr",
"honorificSuffix": "OBE",
"gender": "M",
"dateOfBirth": "2014-05-24T09:54:54.000Z"
},
"contactDetail": {
"mobileNumber": "+44740479251611",
"address": {
"houseNameOrNumber": "1",
"addressLine1": "1 Street Name",
"addressLine2": "Village",
"cityName": "City",
"postalCode": "CV6 5AH",
"stateOrProvince": "AB",
"country": "GB"
}
}
}
},
"token": "JWT Token",
"expireIn": 3600
}
logout
This method logs the user out of the current authenticated session..
Example
window.wyng["_WYNG_ID_"].logout();