-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'package:celest/celest.dart'; | ||
|
||
const auth = Auth( | ||
providers: [ | ||
AuthProvider.google(), | ||
], | ||
); |
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,18 @@ | ||
import 'package:celest/src/auth/auth_provider.dart'; | ||
|
||
/// {@template celest.auth.auth} | ||
/// The authentication component of your Celest project. | ||
/// | ||
/// The Auth widget defines the authentication providers which can be used to | ||
/// sign in to your Celest project. | ||
/// {@endtemplate} | ||
final class Auth { | ||
/// {@macro celest.auth.auth} | ||
const Auth({ | ||
required this.providers, | ||
}); | ||
|
||
/// The authentication providers which can be used by your users when signing | ||
/// in. | ||
final List<AuthProvider> providers; | ||
} |
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,16 @@ | ||
/// {@template celest.auth.auth_provider} | ||
/// An authentication provider which can be used to sign in to Celest. | ||
/// | ||
/// Currently, Celest supports the following authentication methods: | ||
/// - [AuthProvider.google] Sign in with Google | ||
/// {@endtemplate} | ||
sealed class AuthProvider { | ||
const AuthProvider(); | ||
|
||
/// A provider which enables Sign in with Google. | ||
const factory AuthProvider.google() = _GoogleAuthProvider; | ||
} | ||
|
||
final class _GoogleAuthProvider extends AuthProvider { | ||
const _GoogleAuthProvider(); | ||
} |
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