Skip to content

Commit

Permalink
Tokens: Adding AccessToken class for storing accessTokens for OAuth2
Browse files Browse the repository at this point in the history
  • Loading branch information
0Nom4D committed May 22, 2024
1 parent dc5c3bd commit 86ab753
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/api/models/access_token.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// coverage:ignore-file

class AccessToken {
final String accessToken;
final String tokenType;
final int expiresIn;
final String membershipId;

const AccessToken({
required this.accessToken,
required this.tokenType,
required this.expiresIn,
required this.membershipId
});

AccessToken.fromJson(Map<String, dynamic> json) :
accessToken = json["access_token"],
tokenType = json["token_type"],
expiresIn = json["expires_in"],
membershipId = json["membership_id"];

Map<String, dynamic> toJson() {
return <String, dynamic>{
"access_token": accessToken,
"token_type": tokenType,
"expires_in": expiresIn,
"membership_id": membershipId
};
}
}

0 comments on commit 86ab753

Please sign in to comment.